package service

import (
	"CRM_rorm/model"
	"gorm.io/gorm"
)

var Svc *ServiceContext

type ServiceContext struct {
	CompanyProjectModel model.CompanyProjectModel
	StaffProjectModel   model.StaffProjectModel
	ClientProjectModel  model.ClientProjectModel
	ProjectModel        model.ProjectModel
	ProjectMemberModel  model.ProjectMemberModel
}

func NewServiceContext(sqlConn *gorm.DB) {

	Svc = &ServiceContext{
		CompanyProjectModel: model.NewDefaultCompanyProjectModel(sqlConn),
		StaffProjectModel:   model.NewDefaultStaffProjectModel(sqlConn),
		ClientProjectModel:  model.NewDefaultClientProjectModel(sqlConn),
		ProjectModel:        model.NewDefaultProjectModel(sqlConn),
		ProjectMemberModel:  model.NewDefaultProjectMemberModel(sqlConn),
	}

}
